package skipass.command;

import java.util.Calendar;

import skipass.CardStatSystem;
import skipass.container.TimeCard;

public class CheckTime implements Command {
	
	private TimeCard card;
	private CardStatSystem css;

	public CheckTime(TimeCard card, CardStatSystem css) {
		this.card = card;
		this.css = css;
	}
	
	@Override
	public boolean execute() {		
		Calendar curDate = css.getCurrentTime();
		Calendar startDate = card.getStartDate();	
		Calendar endDate = card.getEndDate();
		if(curDate.before(endDate) && curDate.after(startDate))
			return true;				
		else return false;
	}
	
}
